<template>
  <div>
    <h1>自定义指令</h1>
    <hr />
    <input type="text" v-focus />
  </div>
</template>

<script lang="ts">
export default {
  setup() {},
  directives: {
    focus: {
      mounted(el: HTMLElement) {
        el.focus();
      },
    },
  },
};
</script>

<style scoped></style>
